<template>
    <div>
        <el-form :inline="true" :model="searchDate" class="demo-form-inline">
            <el-form-item label="医生姓名">
                <el-input v-model="searchDate.name" placeholder="医生姓名"></el-input>
            </el-form-item>
             <el-form-item label="所属地区">
                <el-input v-model="searchDate.address" placeholder="所属地区"></el-input>
            </el-form-item>
            <el-form-item>
                <el-button type="primary" @click="onSearch">查询</el-button>
            </el-form-item>
            <el-form-item style="float:right">
                <el-button type="primary" @click="onAdd">新增</el-button>
            </el-form-item>
        </el-form>
        <list @goEditer="goEditer" ref="list">
        </list>
        <el-dialog title="医生信息" :visible.sync="show" v-if="show" >
            <show :type="type" :Id="Id" @close="close" >
            </show>
        </el-dialog>
    
    </div>
</template>

<script>
import Show from "@/components/System/Doctor/Show";
import List from "@/components/System/Doctor/List";
export default {
  data() {
    return {
      searchDate: {
        name: "",
        address: ""
      },
      list: [],
      show: false,
      type: "",
      Id: ""
    };
  },
  components: {
    show: Show,
    list: List
  },
  methods: {
    addHospital() {
      var obj = {
        id: "",
        Name: "",
        Tel: "",
        Address: "",
        Distance: "",
        Type: ""
      };
      this.list.push(obj);
      // console.log(this.list);
    },
    onSearch() {
        this.$refs.list.SelectMultipel(this.searchDate);
    },
    onAdd() {
      this.show = true;
      this.type = "新增";
    },
    goEditer(id) {
      this.show = true;
      // console.log(id);
      this.Id = id;
      this.type = "查看";
    },
    close() {
      this.show = false;
      this.$refs.list.getDate();
    }
  }
};
</script>

<style>

</style>
